package pers.course.others;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class EasyBag {
    static int count = 0;
    static int maxLoad = 0;

    public static <Integer> void powerSet(int i, List<Integer> list, List<Integer> li) {
        int load = li.stream().mapToInt(value -> (int) value).sum();
        if (load > maxLoad) {
            return;
        }
        if (i > list.size() - 1) {
            count++;
        } else {
            li.add(list.get(i));
            powerSet(i + 1, list, li);
            li.remove(list.get(i));
            powerSet(i + 1, list, li);
        }
    }

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int num = in.nextInt();
        maxLoad = in.nextInt();
        List<Integer> list = new ArrayList<Integer>();
        List<Integer> li = new ArrayList<Integer>();
        for (int i = 0; i < num; i++) {
            list.add(in.nextInt());
        }
        powerSet(0, list, li);
        System.out.println(count);
    }
}
